// ♣♦♥♠在cmd下显示为问号。
// 解决办法：先在cmd中执行chcp 65001将代码页设为utf-8，然后再执行：
// javac -d bin -encoding utf8 Main.java
// java -cp bin -Dfile.encoding=utf8 Main

class Card {
	char category;
	String number;
	
	public Card(char category, String number) {
		this.category = category;
		this.number = number;
	}

	public String toString() {
		return "" + category + number;
	}
}

class Main {
	public static void main(String[] args) {
		Card cards[] = {
			new Card('♣', "2"),	
			new Card('♣', "3"),	
			new Card('♣', "4"),	
			new Card('♣', "5"),	
			new Card('♣', "6"),
			new Card('♣', "7"),	
			new Card('♣', "8"),	
			new Card('♣', "9"),	
			new Card('♣', "10"),	
			new Card('♣', "J"),	
			new Card('♣', "Q"),	
			new Card('♣', "K"),	
			new Card('♣', "A"),	

			new Card('♦', "2"),	
			new Card('♦', "3"),	
			new Card('♦', "4"),	
			new Card('♦', "5"),	
			new Card('♦', "6"),	
			new Card('♦', "7"),	
			new Card('♦', "8"),	
			new Card('♦', "9"),	
			new Card('♦', "10"),	
			new Card('♦', "J"),	
			new Card('♦', "Q"),	
			new Card('♦', "K"),	
			new Card('♦', "A"),	

			new Card('♥', "2"),	
			new Card('♥', "3"),	
			new Card('♥', "4"),	
			new Card('♥', "5"),	
			new Card('♥', "6"),	
			new Card('♥', "7"),	
			new Card('♥', "8"),	
			new Card('♥', "9"),	
			new Card('♥', "10"),	
			new Card('♥', "J"),	
			new Card('♥', "Q"),	
			new Card('♥', "K"),	
			new Card('♥', "A"),	

			new Card('♠', "2"),	
			new Card('♠', "3"),	
			new Card('♠', "4"),	
			new Card('♠', "5"),	
			new Card('♠', "6"),	
			new Card('♠', "7"),	
			new Card('♠', "8"),	
			new Card('♠', "9"),	
			new Card('♠', "10"),	
			new Card('♠', "J"),	
			new Card('♠', "Q"),	
			new Card('♠', "K"),	
			new Card('♠', "A")
		};

		System.out.println("洗牌前：");
		printAll(cards);
		Card newCards[] = shuffle(cards);
		System.out.println("洗牌后：");
		printAll(newCards);
	}

	static void printAll(Card cards[]) {
		for (int i = 0; i < cards.length; i++) {
			System.out.println(cards[i]);
			
		}
	}

	static Card[] shuffle(Card cards[]) {
		Card newCards[] = new Card[cards.length];

		int k = 0;
		for (int i = 0; i < cards.length / 2; i++) {
			newCards[k] = cards[i];
			k++;
			newCards[k] = cards[i + cards.length / 2];
			k++;
		}

		return newCards;
	}
}
